import ListUi from '../Ui/ListUi'
import React, { useEffect } from 'react';
import { loadDataAsync } from '../actionCreator'
import { useSelector,useDispatch} from 'react-redux'

const CheckList =()=>{
    // const list = useSelector( state => state.getIn(['checklist','list'])) 
    
    let dispatch = useDispatch()
    const list = useSelector( state => state.checklist.getIn(['list'])) 

    useEffect( ()=>{
        dispatch( loadDataAsync() )
    },[dispatch])

    return (
        <ListUi list={ list }></ListUi>
    );
}


export default CheckList;